﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ComTools
{
	public partial class lightControl : UserControl
	{
		public lightControl()
		{
			InitializeComponent();
		}

		public String BitSN
		{
			get
			{
				return label1.Text;
			}
			set
			{
				label1.Text = (value ?? "").Trim();
			}
		}
		public String BitValue
		{
			get
			{
				return label2.Text;
			}
			set
			{
				label2.Text = (value ?? "").Trim();
				int i = 0;
				if (int.TryParse(label2.Text, out i))
				{
					if (i == 0)
					{
						label2.Image = Properties.Resources.gray;
					}
					else
					{
						label2.Image = Properties.Resources.green;
					}
				}
				else
				{
					label2.Image = null;
				}

			}
		}
	}
}